/**
 * Copyright 2012 ibiblio
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// log4j configuration
log4j = {
/*
    root = {
        debug()
    }
    debug   'org.codehaus',
            'org.mortbay',
            'org.springframework',
            'org.hibernate',
            'net.sf'
*/

    appenders {
        console name:'stdout', layout:pattern(conversionPattern: '%d %-5p [%c{2}] (%t) %m%n')
        environments {
            production {
                rollingFile name: 'rollingFile', maxFileSize: 1024, file: '/var/log/jetty6/terasaur.log'
                'null' name: "stacktrace"
            }
        }
    }

    environments {
        production {
            root {
                info 'rollingFile'
            }
        }
        test {
            root {
                info 'stdout', 'file'
            }
        }
        development {
            root {
                info 'stdout', 'file'
            }
        }
    }

    error   'org.codehaus.groovy.grails.web.servlet',  //  controllers
            'org.codehaus.groovy.grails.web.pages', //  GSP
            'org.codehaus.groovy.grails.web.sitemesh', //  layouts
            'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
            'org.codehaus.groovy.grails.web.mapping', // URL mapping
            'org.codehaus.groovy.grails.commons', // core / classloading
            'org.codehaus.groovy.grails.plugins', // plugins
            'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
            'org.codehaus.groovy.grails.scaffolding',
            'org.springframework',
            'org.hibernate',
            'net.sf.ehcache.hibernate',
            'org.apache.commons.digester',
            'org.apache.catalina.core',
            'org.openid4java',
            'org.mortbay.log',
            'org.weceem',
            'org.compass',
            'grails.plugin.webxml',
            'grails.app.service.NavigationService'

    /* enable these to debug urlmappings oddities
    all 	'org.codehaus.groovy.grails.web.mapping.filter',
            'org.codehaus.groovy.grails.web.mapping',
            'org.springframework.security'
    */

    /*
    info	'org.ibiblio.terasaur.bencode',
            'org.ibiblio.terasaur.bt',
            'org.ibiblio.terasaur.db',
            'org.ibiblio.terasaur.item',
            'org.ibiblio.terasaur.lookups',
            'org.ibiblio.terasaur.messaging',
            'org.ibiblio.terasaur.messaging.webqueue',
            'org.ibiblio.terasaur.taglib',
            'org.ibiblio.terasaur.test',
            'org.ibiblio.terasaur.ui',
            'org.ibiblio.terasaur.user'
    */
}
